#!/bin/zsh
setopt extendedglob

cd ~/code/jetpack
if [ $# = 0 ]
then
    set -- $(hg tags | grep '^[0-9]' | sort -n | awk '{ print $1 }')
fi

for tag in $@
do
    echo "Checking $tag"
    hg co -C $tag
    [[ $tag = tip || $tag = . ]] && tag=$(hg log -r $tag --template '{rev}')
    [[ $tag = [0-9a-z]## ]] && tag=hg$tag
    checksums add "Jetpack $tag" **/*.(js|json|html)
done

# vim:se sts=4 sw=4 et ft=sh:
